package com.quick.develop.flowable.enums;

import com.quick.develop.framework.utils.StringUtils;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author junyuan.liu
 * @description:  流程操作类型
 * @date 2022/6/10 16:33
 */
@AllArgsConstructor
@Getter
public enum BpmExecuteCmd {
    /**
     * 操作类型
     */
    DEFAULT("default","处理"),
    CREATE("create","创建"),
    START("start","启动"),
    SAVE("save","保存"),
    SUBMIT("submit", "提交"),
    APPROVE("approve", "审批"),
    COMPLETE_ASSIGN("completeAssign", "完成任务设置人员"),
    CC("cc", "抄送"),
    READ("read", "已阅"),
    BACK("back", "退回"),
    WITHDRAW("withdraw", "撤回"),
    DELEGATE("delegate", "委派"),
    RESOLVE("resolve", "委派完成"),
    ASSIGN("assign", "转办"),
    STOP("stop", "作废"),
    CLAIM("claim", "认领任务"),
    UN_CLAIM("unclaim", "取消认领任务"),
    AUTO_ENTRUST("autoEntrust", "自动委托"),
    RELEASE_ENTRUST("releaseEntrust", "委托解除"),
    AGREE("agree","同意"),
    DISAGREE("disagree","不同意"),
    DRAFT_DELETE("draftDelete", "删除草稿")
    ;
    /**
     * 类型
     */
    public final String cmd;
    /**
     * 说明
     */
    public final String msg;
    
    public static BpmExecuteCmd getBpmExecute(String ex){
        if (StringUtils.isEmpty(ex)) {
            return null;
        }
        for (BpmExecuteCmd enums : values()) {
            if (ex.equals(enums.getCmd())) {
                return enums;
            }
        }
        return null;
    }
}
